package com.example.entity;

import java.util.List;

public class User {
    private List<SysUsr> records;
    private int current;   //当前页
    private int pageSize;  //每页数量
    private int pages;    //总页数
    private int total;    //总记录数
    private int pageIndex;  //计算的值

    public User( int pageIndex,int current, int pagesize, int total) {
        this.pageIndex = (current - 1) * pagesize;
        this.pageSize = pagesize;
        this.total = total;
        this.current = current;
        this.pages = (int) Math.ceil(total / (float) pagesize);
    }

    public List<SysUsr> getRecords() {
        return records;
    }

    public void setRecords(List<SysUsr> records) {
        this.records = records;
    }

    public int getCurrent() {
        return current;
    }

    public void setCurrent(int current) {
        this.current = current;
    }

    public int getPagesize() {
        return pageSize;
    }

    public void setPagesize(int pagesize) {
        this.pageSize = pagesize;
    }

    public int getPages() {
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    @Override
    public String toString() {
        return "User{" +
                "records=" + records +
                ", current=" + current +
                ", pagesize=" + pageSize +
                ", pages=" + pages +
                ", total=" + total +
                ", pageIndex=" + pageIndex +
                '}';
    }
}
